home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / appkit.349 < prev    next >
Text File  |  1992-02-06  |  2KB  |  24 lines

  1. {\rtf0\ansi{\fonttbl\f2\fnil Times-Roman;\f0\fmodern Courier;}
  2. \paperw11760
  3. \paperh7200
  4. \margl120
  5. \margr120
  6. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f2\b0\i0\ul0\fs28 adjust interval
  7. \pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520  Timed Entry\
  8. \
  9. Q:  I've installed a timed entry to run at a specific interval in my app.  I receive a timed entry and my app goes off to process it.  For some reason the processing takes longer than the interval between the timed entries.  The result is that a second entry happens before the app finishes processing the previous entry.   Will the second entry be queued or does it interrupt?\
  10. \
  11. A:  Neither. The timed entry interval specifies the time that passes between the time the timed entry function returns and the time it is called again. Thus, if you have an interval of 10 seconds, and your timed entry function takes 5 seconds to execute, your function will be called every 15 seconds.\
  12. \
  13. Sometimes this might be a bad thing; it is then the responsibility of your timed entry function to adjust the interval.  For instance, in the ClockView class (/NextDeveloper/Examples/Clock under 1.0 and /NextDeveloper/Examples/BusyBox under 2.0), the function that gets called at the top of the minute stops the timed entry and starts it again with an new interval equivalent to the number of seconds left to the next top of the minute. This prevents the clock from “slowing down” and missing minutes when the system is slow. (It however does not bother with this in the seconds mode; missing a second or two here and there is okay.)  \
  14. \
  15. The Animator class shows how to create an “adjusting” timed entry, which is a bit more complex.  The Animator class is used by /NextDeveloper/Examples/BreakApp under 1.0 and /NextDeveloper/Examples/ToolInspector under 2.0.\
  16. \
  17. QA349\
  18. \
  19. Valid for 1.0\
  20. Valid for 2.0\
  21. \
  22.  
  23.  
  24.